// Author: Ivan Chau
package uk.ac.cam.kcic2.math;

public class Scale extends Transform {

	private final double mx,my,mz;
	
	public Scale(double xFactor, double yFactor, double zFactor){
		super(new double[][]{
				{xFactor,0,0,0},
				{0,yFactor,0,0},
				{0,0,zFactor,0},
				{0,0,0,1}
		});
		mx = xFactor;
		my = yFactor;
		mz = zFactor;
	}
	
	public Scale inverse(){
		return new Scale(1/mx, 1/my, 1/mz);
	}
	
	public Scale mult(Scale arg){
		return new Scale(this.mx*arg.mx, this.my*arg.my, this.mz*arg.mz);
	}

	public double maxScale(){return Math.max(mx, Math.max(my, mz));}
}
